package com.letv.core.config;

import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.text.TextUtils;
import com.letv.core.utils.ChannelUtil;
import java.io.IOException;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

/**
 * 主业务相关配置文件
 *
 * @author zhuqiao
 */
public class LetvConfig {

    /**
     * 慢速比上报时间
     */
    public static double SLOW_TIME_OUT = 1.5;

    private static String source;
    private static String flurryKey;
    private static boolean debug;
    private static String pcode;
    private static boolean jingpin;
    private static boolean errorCatch;
    private static boolean umeng;
    private static boolean haveAd;
    private static boolean isForTest;
    private static String appKey;

    private static String splatId;
    private static String sdkFrom;
    private static String videoFileKey;
    private static String appId;

    /**
     * "code": "1003","name": "乐视视频_gPhone",reserve1": "mb"
     */
    private static String clientId;

    static {
        //        try {
        //            Properties properties = new Properties();
        //            InputStream in = LetvConfig.class.getClassLoader().getResourceAsStream("letv.properties");
        //            properties.load(in);

        source = "phone";
        flurryKey = "TFLG6X757KI8QBRICMPM";
        debug = true;
        /** 乐次元移动客户端gPhone(官网)
         170110000
         乐次元移动客户端gPhone(应用宝)
         170110041
         乐次元移动客户端gPhone(360)
         170110106
         乐次元移动客户端gPhone(豌豆荚)
         170110216
         乐次元移动客户端gPhone(百度手机助手)
         170110263
         乐次元移动客户端gPhone(小米应用市场)
         170110116
         乐次元移动客户端gPhone(华为应用市场)
         170110234
         乐次元移动客户端gPhone(魅族)
         170110058
         乐次元移动客户端gPhone(联想)
         170110045 */

        pcode = null;  //乐次元的官网pcode为170110000,基线为010110000
        appKey = "01001020101006800010";
        clientId = "1003";
        errorCatch = false;

        jingpin = true;

        umeng = false;

        haveAd = false;

        isForTest = false;

        splatId = "";
        sdkFrom = "";
        videoFileKey = "";
        appId = "931";     //乐次元的CDE app_id 为 931,基线为3030, jipengfei

        //        } catch (IOException e) {
        //            e.printStackTrace();
        //        }
    }

    public static String getSource() {
        return source;
    }

    public static String getFlurryKey() {
        return flurryKey;
    }

    public static boolean isDebug() {
        return debug;
    }

    public static String getPcode(Context context) {
        if (TextUtils.isEmpty(pcode)) {
            pcode = ChannelUtil.getPcode(context);
        }
        return pcode;
    }

    public static boolean isErrorCatch() {
        return errorCatch;
    }

    public static boolean isJingpin() {
        return jingpin;
    }

    public static boolean isUmeng() {
        return umeng;
    }

    public static boolean isHaveAd() {
        return haveAd;
    }

    public static boolean isForTest() {
        return isForTest;
    }

    public static String getAppKey() {
        return appKey;
    }

    public static String getClientId() {
        return clientId;
    }

    public static void setAppKey(String appkey) {
        appKey = appkey;
    }

    public static void setPCode(String pCode) {
        pcode = pCode;
    }

    public static String getSplatId() {
        return splatId;
    }

    public static String getSdkFrom() {
        return sdkFrom;
    }

    public static String getVideoFileKey() {
        return videoFileKey;
    }

    public static String getAppId() {
        return appId;
    }
}
